<?php
/***********************************************************************
 * @package    	IvanEngine
 * @subpackage 	Core
 * @author     	Ivan <ivanzx@msn.com>
 * @created    	2010-05-15
 ***********************************************************************/
if(defined("IVANENGINE_CORE_EVENT_EVENTSLOT"))
	die("Redefinition macro in :".__FILE__."(".__LINE__.")");
define("IVANENGINE_CORE_EVENT_EVENTSLOT", true);

require_once (dirname(__FILE__).'/../Object.php');
require_once (dirname(__FILE__).'/EventCallBack.php');

class CEventSlot extends CObject
{
	protected $m_callback	= null;
	protected $m_connect	= true;
	public function __construct(CEventCallBack $callback) 
	{
		parent::__construct ();
		$this->m_callback	= $callback;
	}
	
	public function __destruct() 
	{
		unset($this->m_callback);
		parent::__destruct ();
	}
	
	public function Connected()
	{
		$this->m_connect	= true;
	}
	
	public function Disconnect()
	{
		$this->m_connect	= false;
	}
	
	public function IsConnect()
	{
		return $this->m_connect;
	}
	
	public function GetCallBack()
	{
		return $this->m_callback;
	}
}
?>